package cn.lg.soar.system.general.client;

import cn.lg.soar.core.annotations.ApiClient;
import cn.lg.soar.system.api.constant.ModuleConst;
import cn.lg.soar.system.api.service.IRsaKeyApi;
import cn.lg.soar.system.general.service.IPublicService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import springfox.documentation.annotations.ApiIgnore;

/**
 * @author luguoxiang
 * @date 2022/1/16
 * 开源项目：https://gitee.com/lgx1992/lg-soar 求star！请给我star！请帮我点个star！
 */
@ApiIgnore
@ApiClient("boot")
@RestController
@RequestMapping(ModuleConst.CLIENT_PATH + "/rsa")
public class RsaKeyApiClient implements IRsaKeyApi {

    @Autowired
    private IPublicService service;

    @GetMapping("publicKey")
    @Override
    public byte[] getPublicKey(String bizType) {
        return service.getRSAPublicKey(bizType);
    }

    @GetMapping("privateKey")
    @Override
    public byte[] getPrivateKey(String bizType) {
        return service.getRSAPrivateKey(bizType);
    }

}
